Next: Stdio, Previous: Stdlib, Up: Top

## 3 Character Type Macros and Functions (`ctype.h`)

This chapter groups macros (which are also available as subroutines) to classify characters into several categories (alphabetic, numeric, control characters, whitespace, and so on), or to perform simple character mappings.

The header file `ctype.h` defines the macros.

- isalnum: Alphanumeric character predicate (isalnum, isalnum_l)
- isalpha: Alphabetic character predicate (isalpha, isalpha_l)
- isascii: ASCII character predicate (isascii, isascii_l)
- isblank: Blank character predicate (isblank, isblank_l)
- iscntrl: Control character predicate (iscntrl, iscntrl_l)
- isdigit: Decimal digit predicate (isdigit, isdigit_l)
- islower: Lowercase character predicate (islower, islower_l)
- isprint: Printable character predicates (isprint, isprint_l. isgraph, isgraph_l)
- ispunct: Punctuation character predicate (ispunct, ispunct_l)
- isspace: Whitespace character predicate (isspace, isspace_l)
- isupper: Uppercase character predicate (isupper, isupper_l)
- isxdigit: Hexadecimal digit predicate (isxdigit, isxdigit_l)
- toascii: Force integers to ASCII range (toascii, toascii_l)
- tolower: Translate characters to lowercase (tolower, tolower_l)
- toupper: Translate characters to uppercase (toupper, toupper_l)
- iswalnum: Alphanumeric wide character predicate (iswalnum, iswalnum_l)
- iswalpha: Alphabetic wide character predicate (iswalpha, iswalpha_l)
- iswblank: Blank wide character predicate (iswblank, iswblank_l)
- iswcntrl: Control wide character predicate (iswcntrl, iswcntrl_l)
- iswdigit: Decimal digit wide character predicate (iswdigit, iswdigit_l)
- iswgraph: Graphic wide character predicate (iswgraph, iswgraph_l)
- iswlower: Lowercase wide character predicate (iswlower, iswlower_l)
- iswprint: Printable wide character predicate (iswprint, iswprint_l)
- iswpunct: Punctuation wide character predicate (iswpunct, iswpunct_l)
- iswspace: Whitespace wide character predicate (iswspace, iswspace_l)
- iswupper: Uppercase wide character predicate (iswupper, iswupper_l)
- iswxdigit: Hexadecimal digit wide character predicate (iswxdigit, iswxdigit_l)
- iswctype: Extensible wide-character test (iswctype, iswctype_l)
- wctype: Compute wide-character test type (wctype, wctype_l)
- towlower: Translate wide characters to lowercase (towlower, towlower_l)
- towupper: Translate wide characters to uppercase (towupper, towupper_l)
- towctrans: Extensible wide-character translation (towctrans, towctrans_l)
- wctrans: Compute wide-character translation type (wctrans, wctrans_l)